* Date: 07-15-2020
* This is the STATA dofile for replicating main analysis in Table 1 of the following paper.
* Paper: "Signaling Restraint: International Engagement and Rebel Groups’ Commitment to International Law"
* Authors: Hyeran Jo, Joshua Alley, Yohan Park, and Soren Jordan
* Note: this code is tested with stata version 14 as well as version 16. 

clear all
set more off

* set working directory to the main folder 
cd "[the main folder]"
* example below: 
* cd "C:\Users\Desktop\rebel_commitment_replication"

* Load the data
use "commitment data master.dta", clear

* install "estout" package to use "esttab" command: if you already have this, it's fine to skip this line.
ssc install estout, replace

*** Table 1 (Regression results)

set more off

* Model 1: Pooled logit
logit commitment_dum transconstsupp_dum strengthcent_num_4s peacetalk_dum  rebstrength_num_5s terrcont_dum ///
 rebextpart_dum secessionist  age   rebpresosts_dum i.rtypesup_num_3i i.rebpolwing_3i numopp dem_gwf time ///
 t t2 t3 ,  cluster(dyadid2)

est stor m1

* Model 2: Varying intercepts logit (Partial pooling) 
melogit commitment_dum transconstsupp_dum strengthcent_num_4s  peacetalk_dum  rebstrength_num_5s terrcont_dum  ///
 rebextpart_dum secessionist  age   rebpresosts_dum i.rtypesup_num_3i i.rebpolwing_3i numopp dem_gwf time ///
 t t2 t3  || dyadid2:

est stor m2

* Model 3: Varying intercepts logit (Partial pooling) with ideology and cold war period
melogit commitment_dum transconstsupp_dum strengthcent_num_4s peacetalk_dum strengthcent_num_4s rebstrength_num_5s terrcont_dum  ///
 rebextpart_dum secessionist  age   rebpresosts_dum i.rtypesup_num_3i i.rebpolwing_3i coldwar jihadist numopp dem_gwf time  ///
 t t2 t3  || dyadid2:

est stor m3


esttab m* , star(* 0.1 ** 0.05 *** 0.01) b(3) se(3) sca(aic N_clust) label replace nogaps
